home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 48 / Mac Magazin CD 48.iso / Software / Entwickler / Glue Factory folder / CodeToObj folder / About CodeToObj next >
Encoding:
Text File  |  1998-07-07  |  2.2 KB  |  34 lines  |  [TEXT/ttxt]

  1. CodeToObj is a tool that takes the contents of any resource, and turns it into a 68K object code file. This can be useful, for example, for building a block of code that is made memory-resident by other code, but which cannot, for some reason, be stored in a separate code resource (perhaps because the loader code itself takes the form of a non-application code resource!). The resident code must have its own copy of any library code; to ensure this, build it into a temporary code resource with a separate Link operation, then you can include the contents of that resource in the rest of your program with the help of CodeToObj. 
  2.  
  3. Use this tool in an MPW command as follows:
  4.  
  5.     CodeToObj ResFile ResType ResID OutputFile
  6.  
  7. where ResFile is the name of the file containing the resource, ResType is the resource type (which may be specified as either 4 literal characters or 8 hex digits), ResID is the integer resource ID, and OutputFile is the name of the object file to create.
  8.  
  9. Options may be specified anywhere on the command line. The following ones are required:
  10.  
  11. -start StartSym
  12. gives a symbol name to the start of the code.
  13.  
  14. -end EndSym
  15. gives a symbol name to the point immediately after the last byte of the code.
  16.  
  17. The following options may additionally be specified:
  18.  
  19. -segment SegmentName
  20. gives a name to the segment containing the generated code. If omitted, the default is the usual “Main”.
  21.  
  22. -entry EntrySym1[,EntrySym2...]
  23. gives symbol names to one or more entry points within the code (note that there must not be any spaces before or after the commas). If this option is specified, then the resource contents are assumed to begin with a series of longwords, one for each entry point name in sequence, containing the offset from the beginning of the resource to the corresponding entry point. These prefix longwords are stripped off from the generated code.
  24.  
  25. Example
  26.  
  27.     CodeToObj MyRes PROC 128 MyResObj.o -start CodeStart -end CodeEnd
  28.  
  29. This reads the PROC resource with ID 128 from the file MyRes, and puts its contents into an object file with name MyResObj.o. The start of the contents is given the name CodeStart, and the end is named CodeEnd.
  30.  
  31. Lawrence D’Oliveiro
  32. ldo@geek-central.gen.nz
  33. software list: <http://www.geek-central.gen.nz/pages/ldo/sw/>
  34. 1998 July 7